package com.senyin.common;

public class BaseResponse <T>{
    private Integer code;
    private T data;
    private String message;
    private String description;
    private Integer total;

    public BaseResponse(Integer code, String message, String description) {
        this.code = code;
        this.message = message;
        this.description = description;
    }

    public BaseResponse(Integer code, T data, String message, String description) {
        this.code = code;
        this.data = data;
        this.message = message;
        this.description = description;
    }

    public BaseResponse(Integer code, T data, String message, String description, Integer total) {
        this.code = code;
        this.data = data;
        this.message = message;
        this.description = description;
        this.total = total;
    }

    public BaseResponse(ErrorCode errorCode) {
        this(errorCode.getCode(),errorCode.getMessage(), errorCode.getDescription());
    }

    public Integer getCode() {
        return code;
    }

    public T getData() {
        return data;
    }

    public String getMessage() {
        return message;
    }

    public String getDescription() {
        return description;
    }

    public Integer getTotal() {
        return total;
    }
}
